package org.bridge.db.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ResourceBundle;

import org.bridge.db.mapping.DbData;

public class MySqlSimpleConnection implements DBConnection {
	
	private static ResourceBundle bundle = ResourceBundle.getBundle("db");

	public Connection getConnection(DbData dbData) {
		try {
			String url = dbData.getUrl();
			String driver = dbData.getDriver();
			
			Class.forName(driver).newInstance();
			Connection con = DriverManager.getConnection(url);
			return con;
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		
		
		return null;
	}

}
